package io.github.mymonstercat.entity;

import lombok.Data;

@Data
public class HwResult {

    private HwOCRResult result;

    public void cleanWords() {
        if (result != null && result.getWordsBlockList() != null) {
            for (HwWordsBlock block : result.getWordsBlockList()) {
                if (block.getWords() != null) {
                    // 去掉 words 中的空格
                    block.setWords(block.getWords().replaceAll("\\s+", ""));
                }
            }
        }
    }
}
